package com.hu.controller;

import com.hu.config.comment.ResponseResult;
import com.hu.config.rabbitMQ.Sender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/test")
public class TestRabbitMQ {
    @Autowired
    private Sender sender;
    /**
     * 测试消息
     */
    @RequestMapping(value = "/sender", method = RequestMethod.GET)
    @ResponseBody
    public ResponseResult sender() {
//        for (int i=0;i<50;i++){
//            sende1.send(i);
//        }
        for (int i=0;i<50;i++){
            sender.send3(i);
        }
        return ResponseResult.success("ok");
    }

}
